package com.zhumengquan.druid.controller;

import com.zhumengquan.druid.domain.User;
import com.zhumengquan.druid.service.FindUserByIdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
@Controller
public class FindUserByIdController {
    @Autowired
    private FindUserByIdService findUserByIdService;
    @RequestMapping("/finduserbyid")
    @ResponseBody
    public User FindUserById (@RequestParam(value = "id", required = true) Integer id){
        User result =findUserByIdService.getUser(id);
        return result;
    }

}
